package com.robot.service.action_unit;

import com.robot.common.enums.ActionUnitTemplateCode;
import com.robot.common.enums.ActionUnitTypeEnum;
import com.robot.common.enums.BigModelTypeEnum;
import com.robot.dao.action.ActionUnitAiBigModel;
import com.robot.dao.action.ActionUnitWebSearch;
import com.robot.repository.RobotRepoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class ActionUnitImplWebSearch implements ActionUnit{
    @Autowired
    private ActionUnitHelper actionUnitHelper;

    // func执行

    public void run(){
    }

    public  void CreateThis(RobotRepoEntity robot,ActionUnitTemplateCode actionUnitTemplateCode){
        ActionUnitWebSearch actionUnit = new  ActionUnitWebSearch();
        actionUnit.setRobotId(robot.getId());
        actionUnit.setActionUnitType(ActionUnitTypeEnum.SEARCHING.getCode());
        actionUnit.setDetail(new ActionUnitWebSearch.WebSearchingDetail(
                10,5,false
        ));
        actionUnit.setCreateTime(LocalDateTime.now());
        actionUnit.setUpdateTime(LocalDateTime.now());
        actionUnit.setUnitName("联网搜索");
        actionUnit.setUnitTemplateCode(actionUnitTemplateCode.getValue());
        this.actionUnitHelper.CreateActionUnit(actionUnit);
    }
}
